<#include "header.htm"/>
<#import "../macros/pagination.ftl" as pagination>
<#import "../macros/presentation.ftl" as presentation/>

<link rel="alternate" type="application/rss+xml" title="RSS" href="${contextPath}/rss/recentTopics${extension}" />

<table cellspacing="0" cellpadding="1" width="100%" align="center" border="0">
	<tr>
		<td class="bodyline" valign="top">
		
			<#assign breadCrumb>
				<table style="margin-top:10px;" cellspacing="0" cellpadding="2" width="100%" align="center" border="0">
					<tr>
						<td valign="middle" align="left" width="50">
					      <a href="${JForumContext.encodeURL("/jforum${extension}?module=posts&amp;action=insert&amp;forum_id=0", "")}" rel="nofollow" class="icon_new_topic"><img src="${contextPath}/images/transp.gif" alt="" /></a>	
                        </td>
						<td valign="middle" align="left">
							<a class="nav" href="${JForumContext.encodeURL("/forums/list")}">${I18n.getMessage("ForumListing.forumIndex")}</a>
							&raquo;
							<a id="latest3" class="nav" href="${JForumContext.encodeURL("/topicsByPublishTime/list")}">${I18n.getMessage("ForumBase.newestPublish")}</a>
							<#if rssEnabled>
								&nbsp;<a href="${contextPath}/rss/recentTopics${extension}"><img src="${contextPath}/templates/${templateName}/images/xml_button.gif" border="0" align="middle" alt="[XML]" /></a>
							</#if>
						</td>
						<td>&nbsp;
						</td>

						 <td class="nav" nowrap="nowrap" align="right">
		  				<#assign paginationData><@pagination.doPagination "list",-1/></#assign>
						${paginationData}
					  </td>
					</tr>
				</table>
			</#assign>
			
			${breadCrumb}
			
			<table class="forumline" cellspacing="1" cellpadding="1" width="100%" border="0">
				<tr>
					<th class="thcornerl"    nowrap="nowrap" align="center" width="120" >&nbsp;${I18n.getMessage("Forums.Form.ForumName")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center"  >&nbsp;${I18n.getMessage("ForumBase.state")}&nbsp;</th>			
					<th class="thtop" align="center"  >&nbsp;${I18n.getMessage("ForumIndex.topics")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="50">&nbsp;${I18n.getMessage("ForumIndex.answers")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="100">&nbsp;${I18n.getMessage("ForumIndex.author")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="50" >&nbsp;${I18n.getMessage("ForumIndex.views")}&nbsp;</th>
					<th class="thcornerr" nowrap="nowrap" align="center" width="100" >&nbsp;${I18n.getMessage("ForumIndex.lastMessage")}&nbsp;</th>
				</tr>

				<!-- TOPICS LISTING -->
				<#list topics as topic>
				<#assign rowbg><@presentation.rowbg topic/></#assign>
				<tr>
					<td bgcolor="${rowbg}"  valign="middle" align="center"    width="120"><a class="postdetails"   href="${JForumContext.encodeURL("/forums/show/${forums.get(topic_index).getId()}")}" target="_blank">${forums.get(topic_index).getName()}</a></td>
					<td bgcolor="${rowbg}"  valign="middle" align="center"  width="25"><@presentation.folderImage topic/></td>
					<td bgcolor="${rowbg}"    onmouseover="style.backgroundColor='#F5EFFB'" onmouseout="style.backgroundColor='${rowbg}'" >
						<span class="topictitle">
						<a href="${JForumContext.encodeURL("/posts/list/${topic.id}${extension}","")}" target="_blank" title="最后回复(${topic.lastPostBy.username}):${topic.lastPostText}"><#if (topic.title?length == 0)>${I18n.getMessage("ForumBase.noTopic")}<#else>${topic.title?html}</#if></a>
						</span>

<#--			    	<#if topic.paginate>
							<span class="gensmall">
							<br />
							<@pagination.littlePostPagination topic.id, postsPerPage, topic.totalReplies/>				
							</span>
						</#if>	
-->							
					</td>

					<td bgcolor="${rowbg}"  valign="middle" align="center"><span class="name">${topic.totalReplies}</span></td>
					<td bgcolor="${rowbg}"  valign="middle" align="center" nowrap="nowrap">
					    <span class="name">${topic.firstPostTime}</span><br />
						<span class="name"><a href="${JForumContext.encodeURL("/user/profile/${topic.postedBy.id}")}" target="_blank">${topic.postedBy.username}</a></span>
					    
					</td>

					<td bgcolor="${rowbg}"  valign="middle" align="center"><span class="name">${topic.totalViews}</span></td>
					<td bgcolor="${rowbg}"  valign="middle" nowrap="nowrap" align="center">
						<#if (topic.lastPostTime?length > 0)>
							<span class="name">${topic.lastPostTime}<br />
							<a href="${JForumContext.encodeURL("/user/profile/${topic.lastPostBy.id}")}" target="_blank">${topic.lastPostBy.username}</a>

							<#assign startPage = ""/>
							<#if (topic.totalReplies + 1 > postsPerPage?number)>
								<#assign startPage = ((topic.totalReplies / postsPerPage?number)?int * postsPerPage?number) +"/"/>
							</#if>
				            
							<a href="${JForumContext.encodeURL("/posts/list/${startPage}${topic.id}")}?fromAll=0#${topic.lastPostId}" target="_blank"><img src="${contextPath}/templates/${templateName}/images/icon_latest_reply.gif" border="0" alt="Latest Reply" /></a></span>
						</#if>		 
					</td>
				</tr>
				</#list>		
				<!-- END OF TOPICS LISTING -->
			</table>   
			
			${breadCrumb}
		</td>
	</tr>
</table>
<#include "bottom.htm"/>
